//
//  HomeTitleButton.swift
//  Weibo
//
//  Created by 杨雨哲 on 15/6/29.
//  Copyright © 2015年 yyz. All rights reserved.
//

import UIKit

class HomeTitleButton: UIButton {
    
    class func button(title:String) -> HomeTitleButton{
        
        let btn = HomeTitleButton()
        
        btn.frame = CGRectMake(0, 0, 120, 30)
        btn.setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
        btn.setTitle(title + " ", forState: UIControlState.Normal)
        btn.titleLabel?.font = UIFont.systemFontOfSize(17.0)
        btn.setImage(UIImage(named: "navigationbar_arrow_down"), forState: UIControlState.Normal)
        
        return btn
    }

    override func layoutSubviews() {
        super.layoutSubviews()
        titleLabel!.frame.origin.x = 0
        imageView!.frame.origin.x = titleLabel!.bounds.width
    }

}
